AC_INIT([audiothumbnailer], [0.2.0])
AC_CONFIG_SRCDIR([src/main.cpp])
AM_INIT_AUTOMAKE

AC_LANG_CPLUSPLUS
AC_PROG_CXX
AC_PROG_INSTALL

AC_HEADER_STDC

PKG_CHECK_MODULES(IMAGEMAGICK, Magick++, HAVE_IMAGEMAGICK=yes, AC_MSG_ERROR([ +Could not find Magick++]))
AC_SUBST(IMAGEMAGICK_LIBS)
AC_SUBST(IMAGEMAGICK_CFLAGS)

PKG_CHECK_MODULES(TAGLIB, taglib, HAVE_TAGLIB=yes, AC_MSG_ERROR([ +Could not find taglib]))
AC_SUBST(TAGLIB_LIBS)
AC_SUBST(TAGLIB_CFLAGS)

AC_ARG_WITH(pkgconfigdir,
    AC_HELP_STRING([--with-pkgconfigdir],
    [Use the specified pkgconfig dir (default is libdir/pkgconfig)]),
    [pkgconfigdir=${withval}],
    [pkgconfigdir='${libdir}/pkgconfig'])

AC_SUBST([pkgconfigdir])
AC_MSG_NOTICE([pkgconfig directory is ${pkgconfigdir}])

AC_OUTPUT([
    Makefile
    src/Makefile
    man/Makefile
])
